#include "loggerconfigurator.h"

#include <Core/config/config.h>
#include <Core/config/configfile.h>
class LoggerConfiguratorPrivate
{
public:
    LoggerConfiguratorPrivate() {}
    ~LoggerConfiguratorPrivate() {}
    QString level;
    QString file;
    Opl::Core::ConfigFile config;
};

LoggerConfigurator::LoggerConfigurator(QObject *parent) :
    QObject(parent), O_PRIVATE_CREATE(LoggerConfigurator)
{
    O_D(LoggerConfigurator);

    //d->level =
    //d->file = config->value("Logger", "File", "optra.log");
}

LoggerConfigurator::~LoggerConfigurator()
{
    O_PRIVATE_DELETE;
}

bool LoggerConfigurator::Load()
{
    O_D(LoggerConfigurator);
    return d->config.load("config/OptraLog.cfg");
}

QString LoggerConfigurator::GetFile()
{
    O_D(LoggerConfigurator);
    return d->config.value("Logger", "File", "optra.log").toString();
}

QString LoggerConfigurator::GetLevel()
{
    O_D(LoggerConfigurator);
    return d->config.value("Logger", "Level", "Info").toString();
}

QString LoggerConfigurator::GetMode()
{
    O_D(LoggerConfigurator);
    return d->config.value("Logger", "Mode", "Append").toString();
}
